package com.ruicar.afs.cloud.bizcommon.rules.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.bizcommon.enums.rules.RuleTreeExpressType;
import lombok.Data;

@Data
@TableName("afs_rule_express")
public class AfsRuleExpress {
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(type = IdType.INPUT)
    private Long id;
    /**
     * 规则ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long ruleId;
    /**
     * 规则itemId
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long itemId;
    /**
     * 表达式左类型
     */
    private RuleTreeExpressType leftType;
    /**
     * 表达式左关联ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long leftReferenceId;
    /**
     * 表达式操作符信息
     */
    private String operatorInfo;
    /**
     * 表达式右类型
     */
    private RuleTreeExpressType rightType;
    /**
     * 表达式右关联ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long rightReferenceId;
    /**
     * 表达式右值
     */
    private String rightValue;
    /**
     * 表达式右值解释（选择框用）
     */
    private String rightValueNames;
}
